package com.abu.notice.service;

import com.abu.notice.pojo.Notice;
import com.baomidou.mybatisplus.extension.service.IService;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 阿布
 * @since 2021-04-29
 */
public interface NoticeService extends IService<Notice> {
    /**
     * 查询最新的前5个公告
     *
     * @return
     */
    List<Notice> selectLatestNotice();


    Notice selectById(Long noticeId);

    /**
     * 分页查询
     *
     * @param page
     * @param size
     * @return
     */
    HashMap<String, Object> selectByPage(Long page, Long size);

    List<Notice> selectByKey(String key);

    Boolean saveNotice(Notice notice);

    HashMap<String, Object> selectAllByPage(Long page, Long size);

    boolean updateNoticeById(Notice notice);

    List<Notice> selectAllMatched(String key);

    boolean updateNoticeStatusByNoticeId(Long id,Boolean status);

    boolean removeNoticeById(Long noticeId);
}
